MCP Server
The v0 MCP (Model Context Protocol) server allows you to integrate v0's capabilities directly into your IDE, providing seamless access to v0's AI-powered code generation and assistance.
Overview
The v0 MCP server enables your IDE's AI assistant to:
- Create and manage v0 chats
- Access v0's code generation capabilities
- Leverage v0's design and development expertise
- Integrate v0 workflows into your development process
Supported IDEs
The v0 MCP server works with any IDE that supports the Model Context Protocol, including:
- Cursor - AI-powered code editor
- Claude Desktop - Anthropic's Claude desktop application
- VS Code (with MCP extensions)
- Any MCP-compatible IDE
Configuration
Prerequisites
- v0 API Key: Get your API key from your v0 account settings
- Environment Variable: Set your API key as an environment variable:
export V0_API_KEY=your_api_key_here
IDE Configuration
Add the following configuration to your IDE's MCP settings:
Cursor
Add to your Cursor settings (~/.cursor/mcp.json):
{
"mcpServers": {
"v0": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.v0.dev",
"--header",
"Authorization: Bearer ${V0_API_KEY}"
]
}
}
}Claude Desktop
Add to your Claude Desktop configuration (~/.config/claude-desktop/config.json on Linux/macOS or %APPDATA%\Claude Desktop\config.json on Windows):
{
"mcpServers": {
"v0": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.v0.dev",
"--header",
"Authorization: Bearer ${V0_API_KEY}"
]
}
}
}VS Code
Install an MCP extension and add the v0 server configuration:
{
"mcpServers": {
"v0": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.v0.dev",
"--header",
"Authorization: Bearer ${V0_API_KEY}"
]
}
}
}Usage
Once configured, your IDE's AI assistant will have access to v0's MCP tools. You can:
Create Chats
Ask your AI assistant to create new v0 chats with specific prompts:
"Create a v0 chat for building a React dashboard component"Access Chat Information
Get details about existing chats:
"Show me the details of v0 chat ID abc123"Find Chats
Search through your v0 chats:
"Find my v0 chats related to React components"Send Messages
Continue conversations in existing chats:
"Send a message to chat abc123 asking to add dark mode support"Environment Variables
Make sure your V0_API_KEY environment variable is properly set:
macOS/Linux
# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
export V0_API_KEY=your_api_key_hereWindows
# Set permanently
setx V0_API_KEY "your_api_key_here"
# Or set for current session
set V0_API_KEY=your_api_key_hereTroubleshooting
Common Issues
"Command not found: npx"
- Install Node.js and npm: https://nodejs.org/
"Permission denied"
- Ensure your API key is correctly set in the environment variable
- Verify the API key has the necessary permissions
"Connection failed"
- Check your internet connection
- Verify the MCP server URL:
https://mcp.v0.dev - Ensure your firewall allows outbound connections
"Invalid API key"
- Regenerate your API key from v0 account settings
- Ensure the environment variable is properly exported
Next Steps
After configuring the MCP server, explore the Platform API documentation to understand the full range of capabilities available through v0's API.